function logger({getState, dispatch}) {
  return function(next) {
    return function(action) {
      console.log(action.type)
      console.log('pre state', getState())
      next(action)
      console.log('next state', getState())
      return action
    }
  }
}

export default logger